// rest parameters 剩余参数
function sum(...nums) {
  console.log(nums);
}

sum(10)
sum(10, 20)
sum(10, 20, 30)
sum(10, 20, 30, 40, 50)


// spread 展开运算符 
var names = ['abc', 'cba', 'nba']

// var newNames = [...names]
// console.log(newNames);

function foo(name1, name2, name3) {

}

foo(...names)